﻿using System;
using System.Collections;
using System.Runtime.Serialization;
using System.Web;

namespace NWebMock
{
    public interface IHttpModuleCollection : ICollection, ISerializable
    {
        #region Properties

        /// <summary>
        /// Gets a string array containing all the keys (module names) in the HttpModuleCollection.
        /// </summary>
        string[] AllKeys { get; }

        /// <summary>
        /// Gets the IHttpModule object with the specified numerical index from the HttpModuleCollection.
        /// </summary>
        /// <param name="index">The index of the IHttpModule object to retrieve from the collection. </param>
        /// <returns>The IHttpModule object module specified by the index parameter.</returns>
        IHttpModule this[int index] { get; }

        /// <summary>
        /// Gets the IHttpModule object with the specified name from the HttpModuleCollection.
        /// </summary>
        /// <param name="name">The key of the item to be retrieved. </param>
        /// <returns>The IHttpModule object module specified by the name parameter.</returns>
        IHttpModule this[string name] { get; }

        /// <summary>
        /// Gets a NameObjectCollectionBase.KeysCollection instance that contains all the keys in the NameObjectCollectionBase instance.
        /// </summary>
        ICollection Keys { get; }

        #endregion

        #region Methods

        /// <summary>
        /// Returns the IHttpModule object with the specified index from the HttpModuleCollection.
        /// </summary>
        /// <param name="index">The index of the IHttpModule object to return from the collection. </param>
        /// <returns>The IHttpModule member specified by the index parameter.</returns>
        IHttpModule Get(int index);

        /// <summary>
        /// Returns the IHttpModule object with the specified name from the HttpModuleCollection.
        /// </summary>
        /// <param name="name">The key of the item to be retrieved. </param>
        /// <returns>The IHttpModule member specified by the name parameter.</returns>
        IHttpModule Get(string name);

        /// <summary>
        /// Returns the key (name) of the IHttpModule object at the specified numerical index.
        /// </summary>
        /// <param name="index">Index of the key to retrieve from the collection. </param>
        /// <returns>The name of the IHttpModule member specified by the index parameter.</returns>
        string GetKey(int index);

        /// <summary>
        /// Implements the ISerializable interface and raises the deserialization event when the deserialization is complete.
        /// </summary>
        /// <param name="sender">The source of the deserialization event.</param>
        void OnDeserialization(Object sender);

        #endregion
    }
}
